function [] = newton_raphson_reciprocal_tb()
    D = 0.75;
    N = 3;
    A = newton_raphson_reciprocal(D,N);
    assert(A,D,N);

    D = 0.111;
    N = 8;
    A = newton_raphson_reciprocal(D,N);
    assert(A,D,N);


    D = 1;
    N = 2;
    A = newton_raphson_reciprocal(D,N);
    assert(A,D,N);

    D = 0.346238628936239857;
    N = 10;
    A = newton_raphson_reciprocal(D,N);
    assert(A,D,N);

    D = 0.9;
    N = 15;
    A = newton_raphson_reciprocal(D,N);
    assert(A,D,N);
end

function [] = assert(A,D,N)
    if(abs(A-1/D)<10^-N)
        fprintf('\tYes: 1/%.2f=%.6f\n',D,A);
    else
        fprintf('\tNo : 1/%.2f=%.6f, correct is: %.6f\n',D,A,1/D);
    end
end


